package com.lab.common.enums;

public enum EquipmentBorrowStatus {

    USING(1L, "借用中"), END(2L, "已归还");

    private final Long code;
    private final String info;

    EquipmentBorrowStatus(Long code, String info) {
        this.code = code;
        this.info = info;
    }

    public Long getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static EquipmentBorrowStatus getLabStatus(Long code) {
        for (EquipmentBorrowStatus labStatus : EquipmentBorrowStatus.values()) {
            if (labStatus.getCode().equals(code)) {
                return labStatus;
            }
        }
        return USING;
    }
}
